﻿@if (ViewBag.IsAuthenticated == null)
{
    ViewBag.IsAuthenticated = false;
}
@if ((bool)ViewBag.IsAuthenticated && TempData["UserName"] != null)
{
    <text>
    Hello, @Html.ActionLink(TempData["UserName"].ToString(), "UserManager", "Home")!

    
    @*@using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" }))*@
    @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" }))
    {
        @Html.AntiForgeryToken()
        <a href="javascript:document.getElementById('logoutForm').submit()">Log off</a>
    }
    </text>
}
else
{
    <ul>
        <li>@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
        <li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
    </ul>
}
